home *** CD-ROM | disk | FTP | other *** search
- *** ../step03/scm.c Thu Dec 16 13:59:00 1993
- --- scm.c Fri Dec 17 12:10:18 1993
- ***************
- *** 180,185 ****
- --- 180,188 ----
- #else
- #include <varargs.h>
- #endif
- + #ifdef _ABI_SOURCE
- + #include <sys/utsname.h>
- + #endif
- #include "sup.h"
-
- #if __STDC__
- ***************
- *** 424,431 ****
- char *myhost () /* find my host name */
- {
- struct hostent *h;
- ! static char name[MAXHOSTNAMELEN];
-
-
- if (name[0] == '\0') {
- if (gethostname (name,MAXHOSTNAMELEN) < 0)
- --- 427,445 ----
- char *myhost () /* find my host name */
- {
- struct hostent *h;
- ! #ifdef _ABI_SOURCE
- ! static struct utsname name;
-
- + if (*(name.nodename) == '\0') {
- + if (uname (&name) < 0)
- + return (NULL);
- + if ((h = gethostbyname (name.nodename)) == NULL)
- + return (NULL);
- + (void) strcpy (name.nodename,h->h_name);
- + }
- + return (name.nodename);
- + #else
- + static char name[MAXHOSTNAMELEN];
-
- if (name[0] == '\0') {
- if (gethostname (name,MAXHOSTNAMELEN) < 0)
- ***************
- *** 435,440 ****
- --- 449,455 ----
- (void) strcpy (name,h->h_name);
- }
- return (name);
- + #endif
- }
-
- char *remotehost () /* remote host name (if known) */
-